{%extends 'admin/layout.html'%}

{%block content%}
<div class="mdui-container-fluid">

    <div class="mdui-typo">
      <h1> 基本设置 <small>设置PyOne基本参数</small></h1>
    </div>
    <form action="{{url_for('admin.setting')}}" method="POST">
        <div class="mdui-textfield">
          <h4>网站名称</h4>
          <input class="mdui-textfield-input" type="text" name="title" value="{{GetConfig('title')}}"/>
        </div>

        <div class="mdui-textfield">
          <h4>缓存过期时间(秒)</h4>
          <input class="mdui-textfield-input" type="text" name="downloadUrl_timeout" value="{{GetConfig('downloadUrl_timeout')}}"/>
        </div>

        <div class="mdui-textfield">
          <h4>防盗链设置（不限制，则设置：no-referrer；仅限3pp.me调用，则设置：3pp.me；可调用域名通过英文逗号分隔）</h4>
          <input class="mdui-textfield-input" type="text" name="allow_site" value="{{GetConfig('allow_site')}}"/>
        </div>

        <div class="mdui-textfield">
          <h4>统计代码</h4>
          <input class="mdui-textfield-input" type="text" name="tj_code" value="{{GetConfig('tj_code')}}"/>
        </div>

        <div class="mdui-textfield">
          <h4>修改后台密码（如果不修改，则无需输入）</h4>
          <input class="mdui-textfield-input" type="password" name="password1" placeholder="请输入新密码" />
          <input class="mdui-textfield-input" type="password" name="password2" placeholder="请再次输入新密码" />
        </div>

        <div class="mdui-textfield">
          <h4>Aria2信息编辑</h4>
          <div class="mdui-panel" mdui-panel>
              <div class="mdui-panel-item">
                <div class="mdui-panel-item-header">点击配置</div>
                <div class="mdui-panel-item-body">
                  <h5>Aria2协议</h5>
                  <select class="mdui-select" name="ARIA2_SCHEME" mdui-select>
                    <option value="http"{%if GetConfig('ARIA2_SCHEME')=='http'%} selected{%endif%}>http</option>
                    <option value="https"{%if GetConfig('ARIA2_SCHEME')=='https'%} selected{%endif%}>https</option>
                  </select>
                  <h5>主机（默认localhost。如果不是本机的aria2，怎么下载到本机然后上传？？？）</h5>
                  <input class="mdui-textfield-input" type="text" readonly="readonly" name="ARIA2_HOST" placeholder="请输入aria2主机" value="{{GetConfig('ARIA2_HOST')}}" />
                  <h5>端口</h5>
                  <input class="mdui-textfield-input" type="text" name="ARIA2_PORT" placeholder="请输入aria2端口" value="{{GetConfig('ARIA2_PORT')}}" />
                  <h5>秘钥</h5>
                  <input class="mdui-textfield-input" type="text" name="ARIA2_SECRET" placeholder="请输入aria2秘钥" value="{{GetConfig('ARIA2_SECRET')}}" />
                </div>
              </div>
          </div>
        </div>

        <div class="mdui-textfield">
          <h4>网盘信息编辑</h4>
          {%for user in get_od_user()%}
          {%if user[1]!='添加网盘'%}
          <div class="mdui-panel" mdui-panel>
              <div class="mdui-panel-item">
                <div class="mdui-panel-item-header">{{user[1]}}</div>
                <div class="mdui-panel-item-body">
                  <h5>显示名称</h5>
                  <input class="mdui-textfield-input" type="text" name="other_name[{{user[0]}}]" placeholder="请输入显示名称" value="{{user[1]}}" />
                  <h5>分享目录</h5>
                  <input class="mdui-textfield-input" type="text" name="share_path[{{user[0]}}]" placeholder="请输入分享目录" value="{{user[3]}}" />
                </div>
              </div>
          </div>
          {%endif%}
          {%endfor%}
        </div>

       <button type="submit" class="mdui-btn mdui-color-theme-accent mdui-ripple mdui-float-right">
        <i class="mdui-icon material-icons">&#xe161;</i> 保存
       </button>
    </form>
</div>
{%endblock content%}
